Skip to content

Add an interface to support flushing by TsFileResource#17203

Merged
jt2594838 merged 3 commits intomasterfrom
add_flush_interface
Feb 13, 2026
Merged

Add an interface to support flushing by TsFileResource#17203
jt2594838 merged 3 commits intomasterfrom
add_flush_interface

Conversation

@jt2594838
Copy link
Contributor

@jt2594838 jt2594838 commented Feb 13, 2026

And, flushing the same TsFile multiple times will result in the same future, as long as the flush does not complete.

This interface is provided for the pipe to actively flush the downgraded files.

Copy link
Collaborator

@Caideyipi Caideyipi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds a new interface to support flushing by TsFileResource and implements idempotency for flushing operations. When the same TsFile is flushed multiple times before completion, it returns the same Future object.

Changes:

  • Added a new asyncCloseOneTsFileProcessor(TsFileResource) method that accepts a TsFileResource instead of requiring explicit sequence flag and processor parameters
  • Introduced a closeFuture field in TsFileProcessor to cache the Future returned by asyncClose(), enabling idempotent flush operations
  • Refactored the existing asyncCloseOneTsFileProcessor(boolean, TsFileProcessor) method to check for and return cached closeFuture
  • Added test coverage for the new idempotent flush behavior

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 9 comments.

File Description
DataRegionTest.java Changed assertTrue imports from qualified to static import, added new test testFlushSpecifiedResource() to verify idempotent flush behavior
TsFileProcessor.java Added closeFuture field and modified syncClose()/asyncClose() methods to cache and return the same Future for repeated close operations
DataRegion.java Added new public asyncCloseOneTsFileProcessor(TsFileResource) overload and refactored existing method to use closeFuture-based idempotency check

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

❌ Patch coverage is 83.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 39.50%. Comparing base (fe0d62e) to head (4565878).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...ageengine/dataregion/memtable/TsFileProcessor.java 72.72% 3 Missing ⚠️
.../iotdb/db/storageengine/dataregion/DataRegion.java 92.30% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #17203      +/-   ##
============================================
- Coverage     39.50%   39.50%   -0.01%     
  Complexity      282      282              
============================================
  Files          5101     5101              
  Lines        341889   341895       +6     
  Branches      43525    43525              
============================================
  Hits         135069   135069              
- Misses       206820   206826       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
B Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@jt2594838 jt2594838 merged commit 7e0837b into master Feb 13, 2026
29 of 32 checks passed
@jt2594838 jt2594838 deleted the add_flush_interface branch February 13, 2026 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants